﻿using System;
using YWM.Exceptions;

namespace YWM.Application
{
    /// <summary>
    ///  基础程序服务类
    /// </summary>
    public class AppService : IAppService
    {
        /// <summary>
        /// 抛出友好的异常
        /// </summary>
        /// <param name="errorMessage">异常消息</param>
        /// <returns>异常实例</returns>
        protected Exception Oh(string errorMessage)
        {
            return Oops.Oh(errorMessage);
        }

        /// <summary>
        /// 抛出友好的异常
        /// </summary>
        /// <param name="errorMessage">异常消息</param>
        /// <param name="originException">原始异常实例</param>
        /// <returns>异常实例</returns>
        protected Exception Oh(string errorMessage, Exception originException)
        {
            return Oops.Oh(errorMessage, originException);
        }
    }
}
